package adv6;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class Read2 {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new FileReader(
					"E:\\作业\\java56\\11-17-作业.txt"));

			System.out.println((char) br.read());
			String str = null;
			int k = 0;
			System.out.println("mark?" + br.markSupported());
			br.mark(1024 * 8);// 标记后最多能读取多少个字节

			while ((str = br.readLine()) != null) {
				System.out.println((++k) + ":" + str);
			}
			System.out.println("已经读完了，回头。。。。");
			br.reset();// 回到加标记的位置
			while ((str = br.readLine()) != null) {
				System.out.println((++k) + ":" + str);
			}
			br.close();
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}
}
